var color;
if (ds_list_find_value(global.inventory_current_id[0],argument0) == 0)
{
    draw_set_color(c_menured1);
}
else
{
    draw_set_color(c_menuyellow1);
}
draw_set_alpha(1);
draw_set_halign(fa_left);
if (inventory_selected == argument0)
{
    color = c_white;
    draw_rectangle(view_xview[0]+argument1+((argument0-inventory_itemsrow*(floor(argument0/inventory_itemsrow)))*inventory_cellsize),view_yview[0]+argument2+((floor(argument0/inventory_itemsrow))*inventory_cellsize),view_xview[0]+argument1+((argument0-inventory_itemsrow*(floor(argument0/inventory_itemsrow)))*inventory_cellsize)+inventory_cellsize,view_yview[0]+argument2+((floor(argument0/inventory_itemsrow))*inventory_cellsize)+inventory_cellsize,false);
}
else
{
    color = c_menuyellow1;
}
if (ds_list_find_value(global.inventory_current_id[0],argument0) > 0)
{
    draw_sprite(inventory_item_get_sprite(argument0),-1,view_xview[0]+((inventory_cellsize/2)-(sprite_get_width(inventory_item_get_sprite(argument0))/2)+(sprite_get_xoffset(inventory_item_get_sprite(argument0))))+argument1+((argument0-inventory_itemsrow*(floor(argument0/inventory_itemsrow)))*inventory_cellsize),view_yview[0]+((inventory_cellsize/2)-(sprite_get_height(inventory_item_get_sprite(argument0))/2)+(sprite_get_yoffset(inventory_item_get_sprite(argument0))))+argument2+((floor(argument0/inventory_itemsrow))*inventory_cellsize));
    if ((global.team_member_current_id).character_item_equipped == argument0)
    {
        draw_sprite(spr_inventory_equipped,(inventory_selected == argument0),view_xview[0]+argument1+((argument0-inventory_itemsrow*(floor(argument0/inventory_itemsrow)))*inventory_cellsize)+4,view_yview[0]+argument2+((floor(argument0/inventory_itemsrow))*inventory_cellsize)+4);
    }
    if (ds_list_find_value(global.inventory_current_id[2],argument0) > 0)
    {
        draw_set_color(c_white);
        draw_rectangle(view_xview[0]+argument1+((argument0-inventory_itemsrow*(floor(argument0/inventory_itemsrow)))*inventory_cellsize)+4,view_yview[0]+argument2+((floor(argument0/inventory_itemsrow))*inventory_cellsize)+(inventory_cellsize-4),view_xview[0]+argument1+((argument0-inventory_itemsrow*(floor(argument0/inventory_itemsrow)))*inventory_cellsize)+((ds_list_find_value(global.inventory_current_id[2],argument0)/ds_grid_get(global.item,4,ds_list_find_value(global.inventory_current_id[0],argument0)))*(inventory_cellsize-4)),view_yview[0]+argument2+((floor(argument0/inventory_itemsrow))*inventory_cellsize)+(inventory_cellsize-3),false);
    }
    else
    {
        if (ds_list_find_value(global.inventory_current_id[1],argument0) > 1)
        {
            textbox_draw_text(view_xview[0]+(inventory_cellsize/3)+argument1+((argument0-inventory_itemsrow*(floor(argument0/inventory_itemsrow)))*inventory_cellsize),view_yview[0]+((inventory_cellsize/8)*5)+argument2+((floor(argument0/inventory_itemsrow))*inventory_cellsize),string("x")+string(ds_list_find_value(global.inventory_current_id[1],argument0)),color,1);
        }
    }
}
